package modele.beanEntity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Recipe implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8559563707861352155L;
	private Integer id;
	private String title;
	private String sumUp;
	private String description;
	private String imageRef;
	private Integer nbPersons;
	private String cookType;
	private Integer cookExpertise;
	private Integer preparationDuration;
	
	private static final String[] types = {"salad","meal","fish","dessert"};
	
	public static final List<String> getTypes(){
		return new ArrayList<String>(Arrays.asList(types));
	}
	
	
	public Recipe() {
		this.id=0;
		this.title="";
		this.sumUp="";
		this.description="";
		this.imageRef="";
		this.nbPersons=0;
		this.cookType="";
		this.cookExpertise=0;
		this.preparationDuration=0;
	}
	
	public Recipe(Integer id, String title, String sumUp, String description,
			String imageRef, Integer nbPersons, String cookType,
			Integer cookExpertise, Integer preparationDuration) {
		super();
		this.id = id;
		this.title = title;
		this.sumUp = sumUp;
		this.description = description;
		this.imageRef = imageRef;
		this.nbPersons = nbPersons;
		this.cookType = cookType;
		this.cookExpertise = cookExpertise;
		this.preparationDuration = preparationDuration;
	}
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getSumUp() {
		return sumUp;
	}
	public void setSumUp(String sumUp) {
		this.sumUp = sumUp;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getImageRef() {
		return imageRef;
	}
	public void setImageRef(String imageRef) {
		this.imageRef = imageRef;
	}
	public Integer getNbPersons() {
		return nbPersons;
	}
	public void setNbPersons(Integer nbPersons) {
		this.nbPersons = nbPersons;
	}
	public String getCookType() {
		if(cookType == null){
			return "";
		}
		return cookType;
	}
	public void setCookType(String cookType) {
		if(cookType == null){
			this.cookType="";
		}else{
			this.cookType = cookType;
		}
	}
	public Integer getCookExpertise() {
		return cookExpertise;
	}
	public void setCookExpertise(Integer cookExpertise) {
		this.cookExpertise = cookExpertise;
	}
	public Integer getPreparationDuration() {
		return preparationDuration;
	}
	public void setPreparationDuration(Integer preparationDuration) {
		this.preparationDuration = preparationDuration;
	}

	
	@Override
	public String toString() {
		return "Recipe [id=" + id + ", title=" + title + ", sumUp=" + sumUp
				+ ", description=" + description + ", imageRef=" + imageRef
				+ ", nbPersons=" + nbPersons + ", cookType=" + cookType
				+ ", cookExpertise=" + cookExpertise + ", preparationDuration="
				+ preparationDuration + "]";
	}
	
	
}
